home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / U-Z / VideoToolBox Folder / VideoToolboxSources / MaximizeConsoleHeight.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-31  |  1.2 KB  |  42 lines  |  [TEXT/KAHL]

  1. /*
  2. MaximizeConsoleHeight.c
  3. THINK C provides a built-in console. That console is less useful than it might be 
  4. because it opens to only a small size, presumably designed to fit on the smallest 
  5. Mac screen. This routine opens the console to the full height of your main screen. 
  6. Call MaximizeConsoleHeight BEFORE opening the console in THINK C.
  7.  
  8. To change the WIDTH of your THINK C console do this:
  9. #include <console.h>
  10. ...
  11. console_options.ncols=100;
  12.  
  13. HISTORY:
  14. 1/92    dgp wrote it.
  15. 8/27/92    dgp    check for 8-bit quickdraw before using GDevices.
  16. 10/10/92 dgp Reduced maximum console height by one pixel, so as not to clip 
  17.             displayed text.
  18. 2/22/93    dgp replaced GetMBarHeight() by MBarHeight.
  19. */
  20.  
  21. #include "VideoToolbox.h"
  22. #if THINK_C
  23.     #include <LoMem.h>    // MBarHeight
  24.     #include <console.h>
  25. #endif
  26.  
  27. void MaximizeConsoleHeight(void)
  28. {
  29. #if THINK_C
  30.     int error;
  31.     long v;
  32.     
  33.     error=Gestalt(gestaltQuickdrawVersion,&v);
  34.     if(!error && v>=gestalt8BitQD){
  35.         console_options.top=MBarHeight+19;
  36.         console_options.left=1;
  37.         console_options.nrows=
  38.             (**(**MainDevice).gdPMap).bounds.bottom-4-console_options.top;
  39.         console_options.nrows/=console_options.txSize*4/3-1; /* estimate line spacing */
  40.     }
  41. #endif
  42. }